package protocol

import "encoding/json"

type hostMeta struct {
	TargetHost string `json:"targetHost"`
	TargetPort uint16 `json:"targetPort"`
	OriginHost string `json:"originHost"`
	OriginPort uint16 `json:"originPort"`
	Uid        uint32 `json:"uid"`
}

func marshalHostMeta(meta *hostMeta) []byte {
	marshal, _ := json.Marshal(meta)
	return marshal
}
func unMarshalHostMeta(data []byte) *hostMeta {
	meta := &hostMeta{}
	json.Unmarshal(data, &meta)
	return meta
}
